import Vue from "vue";
import VueRouter from "vue-router";

import Login from "@/views/login";
import Layout from "@/views/layout";
import Welcome from "@/views/welcome";
import Users from "@/views/users";
import Roles from "@/views/roles";
import Rights from "@/views/rights";
import Goods from "@/views/goods";
import Params from "@/views/params";
import Categories from "@/views/categories";
import Orders from "@/views/orders";
import Reports from "@/views/reports";
import Add from "@/views/goods/add";

Vue.use(VueRouter);

const router = new VueRouter({
  routes: [
    { path: "/login", component: Login },
    {
      path: "/",
      component: Layout,
      redirect: "/welcome",
      children: [
        { path: "welcome", component: Welcome },
        { path: "users", component: Users },
        { path: "roles", component: Roles },
        { path: "rights", component: Rights },
        { path: "goods", component: Goods },
        { path: "params", component: Params },
        { path: "categories", component: Categories },
        { path: "orders", component: Orders },
        { path: "reports", component: Reports },
        { path: "add", component: Add },
      ],
    },
  ],
});

export default router;
